package cheme.ProcessEditor.Parts.Streams.Tag;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.tools.DragEditPartsTracker;

public class ChemeDragEditPartsTracker extends DragEditPartsTracker
{

	public ChemeDragEditPartsTracker(EditPart sourceEditPart)
	{
		super(sourceEditPart);
	}
	
	/*
	 * Swaps out the initial target edit part(s) for the first edit parts parent.
	 * This is applied to tag components, when a field element is dragged--
	 * since we want the whole component to drag instead of the single field.
	 * (non-Javadoc)
	 * @see org.eclipse.gef.tools.DragEditPartsTracker#createOperationSet()
	 */
	@Override
	protected List createOperationSet()
	{
		List<EditPart> list = new ArrayList<EditPart>();
		list.add(getSourceEditPart().getParent());
		return list;
	}
}
